package org.vector.view;

import org.vector.bean.User;

@SuppressWarnings("serial")
public class WinLoginAfter extends javax.swing.JFrame {
	private javax.swing.JMenu baseset;
	private javax.swing.JMenuItem bookborror;
	private javax.swing.JMenu bookborrorset;
	private javax.swing.JMenuItem bookcome;
	private javax.swing.JMenu bookset;
	private javax.swing.JMenuItem booktypeset;
	private javax.swing.JMenuItem bookxinxiadd;
	private javax.swing.JMenuItem bookxinxilook;
	private javax.swing.JMenuItem changepassword;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JMenuBar jMenuBar1;
	private javax.swing.JMenuItem moneyset;
	private javax.swing.JMenu readerset;
	private javax.swing.JMenuItem readertypeset;
	private javax.swing.JMenuItem readerxinxiadd;
	private javax.swing.JMenuItem readerxinxilook;
	private javax.swing.JMenuItem useradd;
	private javax.swing.JMenuItem userdelete;
	private javax.swing.JMenu userset;
	private User user2;

	public WinLoginAfter(User user) {
		initComponents(user);
		setVisible(true);
	}

	private void initComponents(User user) {
		user2 = user;
		setTitle("图书管理系统");
		jLabel1 = new javax.swing.JLabel();
		jMenuBar1 = new javax.swing.JMenuBar();
		readerset = new javax.swing.JMenu();
		readerxinxiadd = new javax.swing.JMenuItem();
		readerxinxilook = new javax.swing.JMenuItem();
		bookset = new javax.swing.JMenu();
		bookxinxiadd = new javax.swing.JMenuItem();
		bookxinxilook = new javax.swing.JMenuItem();
		bookborrorset = new javax.swing.JMenu();
		bookborror = new javax.swing.JMenuItem();
		bookcome = new javax.swing.JMenuItem();
		baseset = new javax.swing.JMenu();
		booktypeset = new javax.swing.JMenuItem();
		readertypeset = new javax.swing.JMenuItem();
		moneyset = new javax.swing.JMenuItem();
		userset = new javax.swing.JMenu();
		changepassword = new javax.swing.JMenuItem();
		useradd = new javax.swing.JMenuItem();
		userdelete = new javax.swing.JMenuItem();

		setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
		setBounds(new java.awt.Rectangle(500, 300, 745, 582));

		jLabel1.setFont(new java.awt.Font("宋体", 0, 48)); // NOI18N
		jLabel1.setText("欢迎光临");

		readerset.setText("读者信息管理");
		readerset.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N

		readerxinxiadd.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N
		readerxinxiadd.setText("读者信息添加");
		readerxinxiadd.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				readerxinxiaddActionPerformed(evt);
			}
		});
		readerset.add(readerxinxiadd);

		readerxinxilook.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N
		readerxinxilook.setText("读者信息查询与修改");
		readerxinxilook.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				readerxinxilookActionPerformed(evt);
			}
		});
		readerset.add(readerxinxilook);

		jMenuBar1.add(readerset);

		bookset.setText("图书信息管理");
		bookset.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N

		bookxinxiadd.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N
		bookxinxiadd.setText("图书信息添加");
		bookxinxiadd.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				bookxinxiaddActionPerformed(evt);
			}
		});
		bookset.add(bookxinxiadd);

		bookxinxilook.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N
		bookxinxilook.setText("图书信息查询与修改");
		bookxinxilook.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				bookxinxilookActionPerformed(evt);
			}
		});
		bookset.add(bookxinxilook);

		jMenuBar1.add(bookset);

		bookborrorset.setText("图书借阅管理");
		bookborrorset.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N

		bookborror.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N
		bookborror.setText("图书借阅");
		bookborror.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				bookborrorActionPerformed(evt);
			}
		});
		bookborrorset.add(bookborror);

		bookcome.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N
		bookcome.setText("图书归还");
		bookcome.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				bookcomeActionPerformed(evt);
			}
		});
		bookborrorset.add(bookcome);

		jMenuBar1.add(bookborrorset);

		baseset.setText("基础信息维护");
		baseset.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N

		booktypeset.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N
		booktypeset.setText("图书类别设置");
		booktypeset.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				booktypesetActionPerformed(evt);
			}
		});
		baseset.add(booktypeset);

		readertypeset.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N
		readertypeset.setText("读者类别设置");
		readertypeset.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				readertypesetActionPerformed(evt);
			}
		});
		baseset.add(readertypeset);

		moneyset.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N
		moneyset.setText("罚金设置");
		moneyset.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				moneysetActionPerformed(evt);
			}
		});
		baseset.add(moneyset);

		jMenuBar1.add(baseset);

		userset.setText("用户管理");
		userset.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N

		changepassword.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N
		changepassword.setText("修改密码");
		changepassword.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				changepasswordActionPerformed(evt);
			}
		});
		userset.add(changepassword);

		useradd.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N
		useradd.setText("用户添加");
		useradd.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				useraddActionPerformed(evt);
			}
		});
		userset.add(useradd);

		userdelete.setFont(new java.awt.Font("Microsoft YaHei UI", 0, 18)); // NOI18N
		userdelete.setText("用户删除");
		userdelete.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				userdeleteActionPerformed(evt);
			}
		});
		userset.add(userdelete);

		jMenuBar1.add(userset);

		setJMenuBar(jMenuBar1);

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(layout.createSequentialGroup().addGap(276, 276, 276).addComponent(jLabel1)
						.addContainerGap(277, Short.MAX_VALUE)));
		layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(layout.createSequentialGroup().addGap(240, 240, 240).addComponent(jLabel1)
						.addContainerGap(260, Short.MAX_VALUE)));
		pack();
	}

	private void readerxinxiaddActionPerformed(java.awt.event.ActionEvent evt) {
		new WinReaderadd();
	}

	private void readerxinxilookActionPerformed(java.awt.event.ActionEvent evt) {
		new WinReaderxinxilook();
	}

	private void bookxinxiaddActionPerformed(java.awt.event.ActionEvent evt) {
		new WinBookxinxiadd();
	}

	private void bookxinxilookActionPerformed(java.awt.event.ActionEvent evt) {
		new Winbookloo();
	}

	private void bookborrorActionPerformed(java.awt.event.ActionEvent evt) {
		// System.out.println("图书借阅");
		new WinBookborror(user2);
	}

	private void bookcomeActionPerformed(java.awt.event.ActionEvent evt) {
		// System.out.println("图书归还");
		new Winbookcome(user2);
	}

	private void moneysetActionPerformed(java.awt.event.ActionEvent evt) {
		// System.out.println("罚金设置");
		new WinMoneyset();
	}

	private void booktypesetActionPerformed(java.awt.event.ActionEvent evt) {
		// System.out.println("图书类型设置");
		new WinTypeset();
	}

	private void readertypesetActionPerformed(java.awt.event.ActionEvent evt) {
		// System.out.println("读者类型设置");
		new WinReadertypeset();
	}

	private void changepasswordActionPerformed(java.awt.event.ActionEvent evt) {
		// System.out.println("修改密码");
		new Winsetpassword(user2);
	}

	private void useraddActionPerformed(java.awt.event.ActionEvent evt) {
		// System.out.println("用户添加");
		new WinAddUser();
	}

	private void userdeleteActionPerformed(java.awt.event.ActionEvent evt) {
		// System.out.println("用户删除");
		new WinDeleteUser();

	}

	public static void main(String args[]) {
		User user = new User("123", "123");
		new WinLoginAfter(user);
	}

}
